import os,sys
port = "com22"
loop = 100
if len(sys.argv)>=2:
    if sys.argv[1]:
        port = sys.argv[1]
        print sys.argv[1]
    if len(sys.argv)>=3:
        if sys.argv[2]:
            loop = int(sys.argv[2])
            print sys.argv[2]
    
for i in range(loop):
    os.system("main_basic_cmd "+port+" 115200 atlist.cfg "+"log_"+str(i)+'.xls'+" 1")